<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
	function showdata(t)
	{
		if($("#ids"+t).is(":hidden")){
			$("#ids"+t).show();
		}else{
			$("#ids"+t).hide();
		}
	
	}
	
function ouputcsvnew()
{
	$("#if_csv").val(1);
	$("#search").submit();
}

</script>
<title>店铺报表</title>
<body class="withvernav">
<div class="bodywrapper"> {{include file='/public/leftmenu.tpl'}}
  <div class="centercontent">
    <div class="pageheader notab">
      <h1 class="pagetitle">店铺毛利报表</h1>
      <span class="pagedesc">注意：Ebay店铺成本显示为红色，表示当前成本只包含“商品成本+运费+Paypal费用”，并未包含刊登费、交易费、商店租金等</span>
      <div class="menulist">
        <ul class="profile_summary">
          <li class="current"></li>
        </ul>
      </div>
    </div>
    <!--pageheader-->
      {{if $managers || in_array('164',$showpower)}}
          <form class="stdform stdform2"  id="search" method="post" action="/datareport/ajaxbutton?op=searchscanorderPro">
          <input type="hidden" name="starttime" value="{{$starttime}}">
          <input type="hidden" name="if_csv" value="1">
          <input type="hidden" name="endtime" value="{{$endtime}}">
          {{foreach from=$shopname item=res key=key}}
          <input type="hidden" name="shopname" value="{{$res}}" />
          {{/foreach}}
          </form>
        {{/if}} 
        
     
        
    <div id="contentwrapper" class="contentwrapper">
        <form class="stdform stdform2"  id="otherForm" method="post" action="/datareport/ajaxbutton?op=searchscanorderPro">
      <div class="tableoptions" style="padding-bottom:2px;padding-left:12px;">
      发货时间：
     <input type="text"  name="starttime" id="starttime" value="{{$starttime}}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
                  -
     <input type="text"  name="endtime" value="{{$endtime}}" id="endtime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
       <span id="search_list">{{$shopname|getstr:48:0}}</span>
       <input name="shopname" id="shopname" type="hidden" value="{{$shopname}}" />
       <span id="choose_shop_btn" style="border:1px solid #ccc;padding:6px 5px 7px;border-radius:3px;cursor:pointer;" onClick="getShopList()">选择店铺 <img src="/fuman/images/search_down.png" width="14" height="21" align="absmiddle" style="margin-bottom:-4px;"></span>
         订单时间 <input type="text"  name="ordertime" value="{{$ordertime}}" id="ordertime" onClick="WdatePicker({dateFmt:'yyyy-MM '})" class="width100 hasDatepicker" />
        <button class="btn btn_orange btn_search radius50">Search</button>
        
         <input name="isform" type="radio" value="1">马帮
                  <input name="isform" type="radio" value="2">新系统
                  <input name="isform" type="radio" value="0" checked>全部
 {{if $managers || in_array('164',$showpower)}}
<span class="page" style="background-color#fff;border:none;"><a href="javascript:ouputcsvnew();">导出结果到Excel</a></span>
{{/if}} 
    </form>
    </div>
    
        <!--<div class="contenttitle2">
            <h3>店铺信息</h3>
            <small>时间：{{$starttime}}到{{$endtime}}</small>
          </div>
        </div>-->
         <div id="basicform" class="subcontent">
             <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
            <thead>
              <tr>
                <th class="head1">店铺名称</th>
                <th class="head1">总收入</th>
                <th class="head1">成本 RMB</th>
                <th class="head1">毛利 <img src="/fuman/images/icons/alert.png" title="毛利=订单总收入-商品成本-运费-交易费-平台使用费"></th>
                <th class="head1">毛利率</th>
              </tr>
            </thead>
            <tbody>
            
           {{foreach from=$newlist item=res key=key}}
            <tr>
              <td class="head1">{{$key}}</td>
              <td class="head0">{{$res.totalst}}</td>
              <td class="center">
              {{if $res.istui==1}}
              	{{$res.cb}}
              {{else}}
              	{{if $res.platfrom=='Ebay'}}
              		<font color="#FF0000" title="未包含刊登和交易费">{{$res.cb}}</font>
                   {{else}}
                   	{{$res.cb}}
                {{/if}}
              {{/if}}
              	{{if $res.insertionFeeRMB}}
                	[{{$res.startDate}} - {{$res.endDate}}] {{$res.insertionFeeRMB}}
                {{/if}}
              </td>
              <td class="center">{{$res.maol}}</td>
              <td class="center">{{$res.maolv}}%</td>
               </tr>
            {{/foreach}}
            <tr>
              <td class="head1"><B>合计</B></td>
              <td class="head0"><font color="#FF0000"><B>{{$allnewmonty}}</B></font></td>
              <td class="center"><font color="#FF0000"><B>{{$allnewmontycb}}</B></font></td>
              <td class="center"><font color="#FF0000"><B>{{$allnewmontymaol}}</B></font></td>
              <td class="center"><font color="#FF0000"><B>{{$allmallv}}</B></font>%</td>
               </tr>
              </tbody>
            
          </table>
          
        
         
          <br>
          <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
            <colgroup>
            <col class="con1" />
            <col class="con0" />
            <col class="con1" />
            <col class="con0" />
            <col class="con1" />
            <col class="con0" />
            <col class="con1" />
            </colgroup>
            <thead>
              <tr>
                <th class="head0">订单号</th>
                <th class="head1">订单收入金额(含运费收入)</th>
                <th class="head0">扫重</th>
                <th class="head0">国家</th>
                <th class="head0">物流</th>
                <th class="head0">运费</th>
                <th class="head1">商品成本</th>
                <th class="head0">交易费用</th>
                <th class="head0">平台使用费</th>
                <th class="head0">单笔利润</th>
                <th class="head0">利润率</th>
              </tr>
            </thead>
           
            
            {{foreach from=$orderlist item=detail key=key}}
            	 
            <tr>
            <td colspan="11" onClick="showdata('{{$key}}')"><h4>{{$key}}</h4></td>
            </tr>
            <tbody  id="ids{{$key}}">
             {{foreach from=$detail item=li key=key}}
            <tr>
              <td>{{$li.ORDERID}}&nbsp;&nbsp;&nbsp;
              {{if $li.isform==1}}
              <a href="http://192.168.1.100:89/eshop/order.do?method=edit&orderid={{$li.ORDERID}}" target="_blank"><img src="/fuman/images/icons/attachment.png"></a>
              {{else}}
               <a href="/orderlist/orderlist?kw={{$li.ORDERID}}" target="_blank"><img src="/fuman/images/icons/attachment.png"></a>
              {{/if}}
              
              </td>
              <td>{{$li.allmount}}</td>
              <td>{{$li.batch_orderweight}} 克</td>
              <td>{{$li.CUSTOMERRESERVE2}}</td>
              <td>{{$li.batch_shipping_name}}</td>
              <td>{{if $li.freigth=='0'}}请填写运费计算公式{{else}}{{$li.freigth}}{{/if}}</td>
              <td>
              {{if $li.MONEYACTION>0}}{{$li.MONEYACTION}}{{else}}<font color="red">{{$li.MONEYACTION}}</font>{{/if}}
            </td>
              <td>{{$li.PAYPALFEEAMOUNT}}</td>
               <td>{{$li.FINALVALUEFEE}}</td>
               <td>{{if $li.lastprice>0}}{{$li.lastprice}}{{else}}<font color="red">{{$li.lastprice}}</font>{{/if}}</td>
                <td>{{$li.maolilv}}%</td>
            </tr>
             {{/foreach}}
            </tbody>
            {{/foreach}}
           
            
          </table>
         
      
        <br />
      </div>
      <!--subcontent--> 
      
      <!--subcontent--> 
      
    </div>
    <!--contentwrapper--> 
    
  </div>
  <!-- centercontent --> 
  
</div>
<div style="position:absolute;z-index:999;top:105px;border:1px solid #666;left:220px;width:870px;background:#f5f5f5;padding:6px 10px;height:450px;margin-bottom:40px;display:none;" id="ajax_box">
<div style="padding-top:8px;padding-left:12px;height:28px;"><h4 style="float:left">选择要搜索的店铺</h4><span style="float:right">
  <input type="button" name="button" id="button" onClick="setShopInfo()" value="确定选择">&nbsp;&nbsp;
  <input type="button" value="关闭弹层" onClick="closeShowBox()">
</span></div>
<div id="shop_box" style="height:400px;overflow:auto"></div>
</div>
<script type="text/javascript" src="/fuman/js/report.js"></script>
</body>
</html>